﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;

/// <summary>
/// Summary description for dbConn
/// </summary>
public class dbConn
{
	public dbConn()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public void populateAgent(DropDownList dd)
    {
        
        string connString = ConfigurationManager.ConnectionStrings[""].ConnectionString;
        using (SqlConnection conn = new SqlConnection(connString))
        {

            SqlCommand cmd = new SqlCommand("SELECT AgentAgencyAccount  FROM [Commission].[dbo].[EFT]", conn);
            conn.Open();

            SqlDataReader rdr;
            rdr = cmd.ExecuteReader();

            dd.DataSource = rdr;
            dd.DataTextField = "AgentAgencyAccount";
            dd.DataValueField = "AgentAgencyAccount";
            dd.DataBind();

        }

        

    }
}